<?php
/**
 * Created by PhpStorm.
 * User: xing
 * Date: 2018/6/10
 * Time: 下午6:10
 */
namespace app\wechat\controller;

use app\common\controller\Base;
use think\Config;
use think\Db;
use think\Env;
use think\Request;
use EasyWeChat\Factory;

class Common extends Base {

    // easyWechat 小程序实例化
    public $miniProgram;

    //当前用户
    protected $currentCustomer;

    protected $beforeActionList = [
        'filterAction'
    ];

    public function filterAction() {

        // 小程序 easyWechat配置
        $config = [
            'app_id' => config('constants.miniProgramConfig')['appid'],
            'secret' => config('constants.miniProgramConfig')['app_secret'],
        ];

        $this->miniProgram = Factory::miniProgram($config);
    }

}